/**
 * 
 */
package model;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Map;

/**
 * @author Triin
 *
 */
public class PersonForm {
	private String firstName="";
	private String lastName="";
	private String identityCode="";
	private String birthDate="";
	private String country="";
	private String county="";
	private String townVillage="";
	private String streetAddress="";
	private String zipcode="";
	public String getFirstName() {
		return firstName;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getLastName() {
		return lastName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getIdentityCode() {
		return identityCode;
	}
	public void setIdentityCode(String identityCode) {
		this.identityCode = identityCode;
	}
	public String getBirthDate() {
		return birthDate;
	}
	public void setBirthDate(String birthDate) {
		this.birthDate = birthDate;
	}
	public String getZipcode() {
		return zipcode;
	}
	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}
	
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public String getCounty() {
		return county;
	}
	public void setCounty(String county) {
		this.county = county;
	}
	public String getTownVillage() {
		return townVillage;
	}
	public void setTownVillage(String townVillage) {
		this.townVillage = townVillage;
	}
	public String getStreetAddress() {
		return streetAddress;
	}
	public void setStreetAddress(String streetAddress) {
		this.streetAddress = streetAddress;
	}
	public PersonForm addData(Map<String,String[]> parameters){
		if(parameters.containsKey("first_name")){
			this.setFirstName(parameters.get("first_name")[0]);
		}
		if(parameters.containsKey("last_name")){
			this.setLastName(parameters.get("last_name")[0]);
		}
		if(parameters.containsKey("identity_code")){
			this.setIdentityCode(parameters.get("identity_code")[0]);
		}
		if(parameters.containsKey("birth_date")){
			this.setBirthDate(parameters.get("birth_date")[0]);
		}
		if(parameters.containsKey("country")){
			this.setCountry(parameters.get("country")[0]);
		}
		if(parameters.containsKey("county")){
			this.setCounty(parameters.get("county")[0]);
		}
		if(parameters.containsKey("town_village")){
			this.setTownVillage(parameters.get("town_village")[0]);
		}
		if(parameters.containsKey("street_address")){
			this.setStreetAddress(parameters.get("street_address")[0]);
		}
		if(parameters.containsKey("zipcode")){
			this.setZipcode(parameters.get("zipcode")[0]);
		}
		return this;

	}
}
